package com.baize.markwondemo.spans;

import android.content.Context;
import android.graphics.Color;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.util.Log;
import android.view.View;

public class CustomHashSpan extends URLSpan {
    private Context context;
    private String url; //channel jumpUrl
    private boolean clickable;

    public CustomHashSpan(Context context, String url, boolean clickable) {
      super(url);
      this.context = context;
      this.url = url;
      this.clickable = clickable;
    }

    @Override
    public void onClick(View widget) {
      Log.i("baize", "onClick: ");
//      LogUtil.d2(LOG_TAG, "[onClick] url=" + url);
      if (!clickable) return;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
      super.updateDrawState(ds);
      ds.setUnderlineText(false);      //设置下划线
      ds.setColor(Color.RED);       //设置文件颜色
    }
  }